package com.jkdz.spyke.rs
{
	import com.jkgh.remedy.core.client.*;
	import flash.utils.ByteArray;

	public class SpykeRoomRemoter implements RemedyRemoter
	{
		private var mo:SpykeRoom;

		public function SpykeRoomRemoter(mo:SpykeRoom)
		{
			this.mo = mo;
		}

		public function call(methodID:int, connection:RemedyClientServerConnection, onReturn:Function):void
		{
			switch (methodID)
			{
				case 50:
					mo.getAllWidgets(function(ret:Vector.<SpykeWidget>):void {
						onReturn(ret, RemedyArrayClassManager.forType(65));
					});
					break;
			}
		}

		public function run(methodID:int, connection:RemedyClientServerConnection):void
		{
			switch (methodID)
			{
				case 51:
					var a_51:SpykeRoomListener = (SpykeRoomListener)(RemedyMOClassManager.INSTANCE.readWithGraph(connection, new Vector.<Object>()));
					mo.registerListener(a_51);
					break;
			}
		}
	}
}
